package com.hb.guli.service.edu.controller.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hb.guli.common.base.result.R;
import com.hb.guli.service.edu.entity.Course;
import com.hb.guli.service.edu.entity.vo.CourseQueryVo;
import com.hb.guli.service.edu.entity.vo.CourseVo;
import com.hb.guli.service.edu.entity.vo.WebCourseQueryVo;
import com.hb.guli.service.edu.service.CourseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@Api("课程管理")
@RestController
@RequestMapping("/api/edu/course")
@Slf4j
public class ApiCourseController {

    @Autowired
    private CourseService courseService;

    @ApiOperation(value = "课程列表")
    @GetMapping("list")
    public R listPage(@ApiParam(value = "课程列表查询对象") WebCourseQueryVo webCourseQueryVo) {

       List<Course> courseList =  courseService.webSelectList(webCourseQueryVo);

        return R.ok().data("courseList",courseList);
    }
}
